package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        String value = map.put("name","上邪");
        map.put("age","22");
        map.put("hobby","lol");
        System.out.println(map);

        value = map.put("name","青邪");
        System.out.println(map);
        System.out.println(value);

        int size = map.size();
        System.out.println("size:" + size);

        value = map.remove("name");
        System.out.println(map);
        System.out.println(value);

        boolean ck = map.containsKey("上邪");
        boolean cv = map.containsValue("22");
        System.out.println("包含key："+ ck);
        System.out.println("包含value："+ cv);
    }
}
